ChatSession
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Version: | 1.0.0 |
| Author: | The gotoAndPlay() Team http://www.smartfoxserver.com http://www.gotoandplay.it |
| Classpath: | com.smartfoxserver.redbox.data.ChatSession |
| File last modified: | Tuesday, 01 July 2008, 15:36:32 |
The ChatSession class is a container for a/v chat session data.
Summary
Class properties
- STATUS_PENDING : String
- Chat session status: "pending".
- STATUS_ACCEPTED : String
- Chat session status: "accepted".
- STATUS_ACTIVE : String
- Chat session status: "active".
Instance properties
- id : String
- The chat session id.
- status : String
- The chat session status.
- requestType : String
- The a/v chat request type.
- iAmRequester : Boolean
- A flag indicating if the current user is the requester of the a/v chat session.
- enableCamera : Boolean
- A flag indicating if the video stream for the current a/v chat session is enabled.
- enableMicrophone : Boolean
- A flag indicating if the audio stream for the current a/v chat session is enabled.
- myStream : NetStream
- The outgoing NetStream object of the current user.
- mateId : Number
- The SmartFoxServer's user id of the chat mate.
- mateName : String
- The SmartFoxServer's user name of the chat mate.
- mateStream : NetStream
- The incoming NetStream object of the chat mate.
Instance methods
- toString : String
- Trace chat session attributes (for debug purposes).
Class properties
STATUS_ACCEPTED
static STATUS_ACCEPTED:String = "accepted"
(read)
Chat session status: "accepted".
The chat request has been accepted: waiting for streaming to start.
The chat request has been accepted: waiting for streaming to start.
See also:
STATUS_ACTIVE
static STATUS_ACTIVE:String = "active"
(read)
Chat session status: "active".
Chat session currently in progress.
Chat session currently in progress.
See also:
STATUS_PENDING
static STATUS_PENDING:String = "pending"
(read)
Chat session status: "pending".
The chat request has been sent or received: waiting for acceptance or refusal.
The chat request has been sent or received: waiting for acceptance or refusal.
See also:
Instance properties
enableCamera
enableCamera:Boolean
(read)
A flag indicating if the video stream for the current a/v chat session is enabled.
The value of this property matches the enableCamera parameter passed to the com.smartfoxserver.redbox.AVChatManager.sendChatRequest method by the a/v chat requester.
The value of this property matches the enableCamera parameter passed to the com.smartfoxserver.redbox.AVChatManager.sendChatRequest method by the a/v chat requester.
enableMicrophone
enableMicrophone:Boolean
(read)
A flag indicating if the audio stream for the current a/v chat session is enabled.
The value of this property matches the enableMicrophone parameter passed to the com.smartfoxserver.redbox.AVChatManager.sendChatRequest method by the a/v chat requester.
The value of this property matches the enableMicrophone parameter passed to the com.smartfoxserver.redbox.AVChatManager.sendChatRequest method by the a/v chat requester.
iAmRequester
iAmRequester:Boolean
(read)
A flag indicating if the current user is the requester of the a/v chat session.
This property, in conjunction with the requestType property, indicates which streams are available once the a/v chat is started (after the invitation is accepted).
See the com.smartfoxserver.redbox.events.RedBoxChatEvent.onChatStarted event documentation for more details.
This property, in conjunction with the requestType property, indicates which streams are available once the a/v chat is started (after the invitation is accepted).
See the com.smartfoxserver.redbox.events.RedBoxChatEvent.onChatStarted event documentation for more details.
id
id:String
(read)
The chat session id.
This id should be used to identify the proper chat window when the acceptance or refusal to start an a/v chat is received.
This id should be used to identify the proper chat window when the acceptance or refusal to start an a/v chat is received.
Usage:
- When a user sends a request to start an a/v chat to his/her mate, usually from within a private chat window, the returned session id should be saved properly so that the window instance can be retrieved easily when the reply to that invitation is received.
In this way it's possible to show the mate's stream (in case of invitation accepted) or a refusal message.
mateId
mateId:Number
(read)
The SmartFoxServer's user id of the chat mate.
mateName
mateName:String
(read)
The SmartFoxServer's user name of the chat mate.
mateStream
mateStream:NetStream
(read)
The incoming NetStream object of the chat mate.
Depending on the iAmRequester and requestType properties, this NetStream object could be
Depending on the iAmRequester and requestType properties, this NetStream object could be
null. See the com.smartfoxserver.redbox.events.RedBoxChatEvent.onChatStarted event documentation for more details. myStream
myStream:NetStream
(read)
The outgoing NetStream object of the current user.
Accessing the user's outgoing stream can be useful to pause/resume the live stream. Pausing and resuming the live stream can be achieved using the NetStream.attachVideo method, passing
Depending on the iAmRequester and requestType properties, this NetStream object could be
Accessing the user's outgoing stream can be useful to pause/resume the live stream. Pausing and resuming the live stream can be achieved using the NetStream.attachVideo method, passing
null to pause and Camera.get() to resume.Depending on the iAmRequester and requestType properties, this NetStream object could be
null. See the com.smartfoxserver.redbox.events.RedBoxChatEvent.onChatStarted event documentation for more details. requestType
requestType:String
(read)
The a/v chat request type.
This property indicates what the requester wants to achieve: send his own live stream, receive his mate's stream, or both.
It can have the following values: com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_SEND, com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_RECEIVE or com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_SEND_RECEIVE.
The request type can be useful to make proper interface changes when accepting an invitation to start an a/v chat.
This property indicates what the requester wants to achieve: send his own live stream, receive his mate's stream, or both.
It can have the following values: com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_SEND, com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_RECEIVE or com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_SEND_RECEIVE.
The request type can be useful to make proper interface changes when accepting an invitation to start an a/v chat.
Usage:
- User A sends a chat invitation to user B, of type com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_RECEIVE: this means that user A would like to receive user B's a/v stream.
If user B accepts the invitation, due to the request type, his own Camera output should be attached to the interface in order to let user B know that he is transmitting a live stream to user A.
On the contrary, if user A sends a chat invitation of type com.smartfoxserver.redbox.AVChatManager.REQ_TYPE_SEND (he wants to show his own live video to user B), user B doesn't need to see his own Camera output as he is not sending a stream to user A.
status
status:String
(read)
The chat session status.
The following statuses are available: STATUS_PENDING, STATUS_ACCEPTED and STATUS_ACTIVE.
The following statuses are available: STATUS_PENDING, STATUS_ACCEPTED and STATUS_ACTIVE.
Instance methods
toString
function toString (
) : String
Trace chat session attributes (for debug purposes).
Returns:
- A string containing the chat session's attributes.